#include <iostream>
#include <string>
#include <XService.h>
#include <thread_pool/XThreadPool.h>
#include "XDirServiceHandle.h"
using namespace std;
class XTestService:public XService{
public:
    XServiceHandle *CreateServiceHandle() override
    {
        return new XDirServiceHandle();
    }
};
int main(int argc, char *argv[])
{
    int server_port = 20011;
    if(argc > 1){
        server_port = atoi(argv[1]);
    }
    XDirServiceHandle::RegMsgCallback();
    cout << "server_port:" << server_port << endl;
    XTestService service;
    service.set_server_port_(server_port);
    service.set_thread_count_(3);
    service.Start();
    XThreadPool::Wait();
}